package com.oracle.oa.entity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;



@Entity                        
@Table(name="precontract")
public class Precontract  implements java.io.Serializable {

	 private static final long serialVersionUID = 1L;

	 @GenericGenerator(name = "generator", strategy = "increment")
	 @Id
	 @GeneratedValue(generator = "generator")
	 @Column(name = "precontractid", unique = true, nullable = false)       
     private int precontractid;
	 
	 @ManyToOne
	 @JoinColumn(name = "schedule_id")
     private Schedule schedule;
	 
	 @ManyToOne
	 @JoinColumn(name = "userinfo_id")
     private Userinfo userinfo;
	 
	public int getPrecontractid() {
		return precontractid;
	}
	public void setPrecontractid(int precontractid) {
		this.precontractid = precontractid;
	}
	public Schedule getSchedule() {
		return schedule;
	}
	public void setSchedule(Schedule schedule) {
		this.schedule = schedule;
	}
	public Userinfo getUserinfo() {
		return userinfo;
	}
	public void setUserinfo(Userinfo userinfo) {
		this.userinfo = userinfo;
	}
	public Precontract(int precontractid, Schedule schedule, Userinfo userinfo) {
		this.precontractid = precontractid;
		this.schedule = schedule;
		this.userinfo = userinfo;
	}
	public Precontract() {
		super();
	}
	@Override
	public String toString() {
		return "Precontract [precontractid=" + precontractid + ", schedule="
				+ schedule + ", userinfo=" + userinfo + "]";
	}


}